<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    *{margin: 0;padding: 0;}
    #box{
        width: 300px;
        height: 300px;
        background: aquamarine;
        border: 1px solid #ccc;
        padding: 10px;
        margin: 50px;
    }
    </style>
</head>
<body>
<div id="box"></div>
<script src="js/jquery-3.6.0.min.js"></script>
<script>
$(function(){
    console.log( $("#box").width());  //300
    //$("#box").width(500);
    console.log( $("#box").innerWidth());   //320
    console.log( $("#box").outerWidth());   //322
    console.log( $("#box").outerWidth(true));  //422  
})
</script>
</body>
</html>